<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <div id="box"></div>
</body>
<script>
    function max(){
        var n = arguments[0];//设置初始值
        for (var i = 0 ; i < arguments.length; i++){//遍历数组所有数
            n = n > arguments[i] ? n : arguments[i];//对数组内的数按顺序进行比较，取最大值
        }
        return n;
    }
    var box = document.getElementById('box');
    var a = max(99,454,8,7);
    box.innerHTML = '输出数组为(99,454,8,7)，其中最大值为' + a;
</script>
</html>